<template>
    <div>
      <el-card class="box-card" v-if="contractInfoFormData.student">
        <div slot="header" class="clearfix">
          <span>用户信息</span>
          <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
        </div>
        <contract-form :contractInfo="contractInfoFormData.student"/>
      </el-card>
      <el-card class="box-card" v-if="contractInfoFormData.reportForm">
        <div slot="header" class="clearfix">
          <span>填表信息</span>
          <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
        </div>
        <client-form :clientForm="contractInfoFormData.reportForm"/>
      </el-card>
      <!-- <el-card class="box-card" v-if="contractInfoFormData.goodsList">
        <div slot="header" class="clearfix">
          <span>商品信息</span>
          <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
        </div>
        <goods-table :goodsList="contractInfoFormData.goodsList" :contract="contractInfoFormData.contract"/>
      </el-card>
      <el-card class="box-card" v-if="contractInfoFormData.salesman">
        <div slot="header" class="clearfix">
          <span>销售人员信息</span>
          <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
        </div>
        <salesman-form :salesmanForm="contractInfoFormData.salesman"/>
      </el-card> -->
    </div>
</template>

<script>
import ClientForm from './ClientForm.vue'
import ContractForm from './ContractForm.vue'
import GoodsTable from './GoodsTable.vue'
import SalesmanForm from './SalesmanForm.vue'

	export default {
		name: 'ContractInfo',
		data() {
			return {
				contractInfoFormData:{}
			}
    	},
		props: ['contractInfo'],
		components: {
			ContractForm,
			ClientForm,
			SalesmanForm,
			GoodsTable
		},
		watch:{
			contractInfo: function(n, o){
				this.contractInfoFormData = n
				console.log("更新", this.contractInfoFormData);
			}
		},
		created() {
			console.log("创建");
			this.contractInfoFormData = this.contractInfo
		}
	}
</script>

<style scoped>
    .box-card{
      margin: 10px;
    }
</style>